
#/bin/bash
GIT_HEAD=`git rev-parse --abbrev-ref HEAD | grep -v HEAD || git describe --exact-match HEAD`
GIT_HASH=`git rev-parse HEAD`
BUILD_TIME=`date '+%Y-%m-%d %H:%M:%S'`
GRADLE_VERSION=`(gradle --version | grep Gradle | awk '{print $2}')`
OS=`(gradle --version | grep OS | awk '{print $2}')`
JVM=`(gradle --version | grep JVM | awk '{print $2}')`

echo "Head              :${GIT_HEAD}" > src/resources/VERSION
echo "Hash              :${GIT_HASH}" >> src/resources/VERSION
echo "BuildTime         :${BUILD_TIME}" >> src/resources/VERSION
echo "GradleVersion     :${GRADLE_VERSION}" >> src/resources/VERSION
echo "OS                :${OS}" >> src/resources/VERSION
echo "JVM               :${JVM}" >> src/resources/VERSION